package com.toread.platform.hystrix;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * Created by toread on 17-8-10.
 */
@Component
public class StoreIntegration {
    private static final Logger logger = LoggerFactory.getLogger(StoreIntegration.class);

    @HystrixCommand(fallbackMethod = "defaultStores")
    public Object getStores(Map<String, Object> parameters) {
        logger.info(parameters.toString());
        throw new RuntimeException();
    }

    public Object defaultStores(Map<String, Object> parameters) {
        return "服务器繁忙";
    }
}
